package com.java.system.common.entity.admin;

import com.java.system.common.validatedGroup.Add;
import com.java.system.common.validatedGroup.Modify;
import com.wordnik.swagger.annotations.ApiModel;
import com.wordnik.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.persistence.Id;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.Pattern;
import java.io.Serializable;
import java.util.Date;

/**
 * 应用表(SysApp)实体类
 *
 * @author yangyuwei
 * @since 2019-06-17 15:46:53
 */
@ApiModel(value = "应用类")
@Data
@Accessors(chain = true)
public class SysApp implements Serializable {
    //主键
    private static final long serialVersionUID = 532560302141339914L;
    @ApiModelProperty(value = "主键Id")
    @Id
    @Null(message = "{add_id}" ,groups = {Add.class})
    @NotNull(message = "{modify_id}",groups = {Modify.class})
    private String id;
    @ApiModelProperty(value = "应用id")
    @NotBlank(message = "{app_null}")
    @Pattern(regexp = "^[\\s\\S]{1,20}$",message = "{name_rule}")
    private String appid;
    @ApiModelProperty(value = "应用密钥")
    @NotBlank(message = "{secret_null}")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,20}$", message = "{password_error}")
    private String secret;
    //加密后秘钥
    @ApiModelProperty(value = "加密后的应用密钥")
    private String secretEncode;
    //备注
    private String remark;
    //过期时间(单位:秒)
    @ApiModelProperty(value = "过期时间")
    @Pattern(regexp = "^[0-9]$",message = "{expireTime_error}")
    private Integer expireTime;
    //同一时间是否只允许单个应用在线
    @ApiModelProperty(value = "同一时间是否只允许单个应用在线")
    private Boolean isOnly;
    //可以访问的应用名称
    @ApiModelProperty(value = "允许访问的应用名称")
    private String scope;
    //创建人id
    private String crtUser;
    //创建人姓名
    private String crtName;
    //创建时间
    private Date crtTime;
    //最后修改人id
    private String updUser;
    //最后修改人姓名
    private String updName;
    //最后修改时间
    private Date updTime;
    //逻辑删除标识：1=删除；0=未删除
    private int delFlag;
    //是否校验token
    @ApiModelProperty(value="是否校验token")
    private Integer type;
    //预留字段
    private String attr1;
    //预留字段
    private String attr2;
    //预留字段
    private String attr3;
}